package com.cac.demo.newCode.compreQuery.controller;

import com.cac.demo.newCode.compreQuery.dto.*;
import com.cac.demo.newCode.compreQuery.service.ComPackAoQueryService;
import com.cac.demo.util.AccessLog;
import com.cac.demo.util.adapter.ResponseMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @author zty
 * @description
 * @date 2024/10/22
 */
@RestController
@RequestMapping("compackageAoQueryController")
@Slf4j
@Api(tags = "分拣任务综合查询")
public class ComPackAoQueryController {

    //记录日志
    Logger logger = LoggerFactory.getLogger(this.getClass());


    @Resource
    private ComPackAoQueryService comPackAoQueryService;

    @PostMapping("/queryAOList")
    @ApiOperation(value = "查询AO列表")
    public ResponseMsg<Object> queryAOList(@RequestBody QueryAoRequestDTO queryAoRequestDTO) {
        return comPackAoQueryService.queryAOList(queryAoRequestDTO);
    }

    @PostMapping("/queryAoBillInfoList")
    @ApiOperation(value = "查询配套清单列表")
    public ResponseMsg<Object> queryAoBillInfoList(@RequestBody QueryAoBillInfoDTO queryAoBillInfoDTO) {
        return comPackAoQueryService.queryAoBillInfoList(queryAoBillInfoDTO);
    }


    @PostMapping("/queryMatchInfoList")
    @ApiOperation(value = "查询物料清单列表")
    public ResponseMsg<Object> queryMatchInfoList(@RequestBody QueryMatchInfoDTO queryMatchInfoDTO) {
        return comPackAoQueryService.queryMatchInfoList(queryMatchInfoDTO);
    }

    /**
     * 根据条件查询工作包
     *
     * @param queryPackageListDTO
     * @return
     */
    @PostMapping("/searchPackageList")
    @ApiOperation(value = "查询工作包列表")
    public ResponseMsg<Object> searchPackageList(@RequestBody QueryPackageListDTO queryPackageListDTO) {
        return comPackAoQueryService.searchPackageList(queryPackageListDTO);
    }

    /**
     * 根据工作包ID查询AO列表
     *
     * @param queryPackageAOListDTO
     * @return
     */
    @PostMapping("/queryPackageAOList")
    @ApiOperation(value = "根据工作包ID查询AO列表")
    public ResponseMsg<Object> queryPackageAOList(@RequestBody QueryPackageAOListDTO queryPackageAOListDTO) {
        return comPackAoQueryService.queryPackageAOList(queryPackageAOListDTO);
    }

    /**
     * 根据工作包ID查询AO列表下的物料清单
     *
     * @param queryPackageAoMatchDTO
     * @return
     */
    @PostMapping("/queryPackageAoMatch")
    @ApiOperation(value = "根据工作包ID查询AO列表下的物料清单")
    public ResponseMsg<Object> queryPackageAoMatch(@RequestBody QueryPackageAoMatchDTO queryPackageAoMatchDTO) {
        return comPackAoQueryService.queryPackageAoMatch(queryPackageAoMatchDTO);
    }

    /**
     * 根据工作包ID查询AO列表下的配套清单
     *
     * @param queryPackageAoFaciDTO
     * @return
     */
    @PostMapping("/queryPackageAoFacili")
    @ApiOperation(value = "根据工作包ID查询AO列表下的配套清单")
    public ResponseMsg<Object> queryPackageAoFacili(@RequestBody QueryPackageAoFaciDTO queryPackageAoFaciDTO) {
        return comPackAoQueryService.queryPackageAoFacili(queryPackageAoFaciDTO);
    }

    /**
     * 查询计划管理统计数据
     * @return
     */
    @PostMapping("/queryProgramManagCount")
    @ApiOperation(value = "查询计划管理统计分拣数据")
    @AccessLog(LogType="查询计划管理统计数据",sendOrReceive="send")
    public ResponseMsg<Object> queryProgramManagCount(@RequestBody ProgramManageDTO programManageDTO){
      return comPackAoQueryService.queryProgramManagCount(programManageDTO);
    }
}
